package com.lefevre.cms.bean.topic;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 话题取消隐藏
 *
 * @author Lefevre
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("topic_unlock")
@Entity
@Table(name = "topic_unlock", indexes = {@Index(name = "topic_unlock_1_idx", columnList = "topicId,cancelTime")})
public class TopicUnhide implements Serializable {

    private static final long serialVersionUID = 6455873305843959259L;

    /**
     * ID (结构：取消隐藏的用户Id_隐藏标签类型_话题Id)
     **/
    @Id
    @Column(length = 43)
    @TableId(type = IdType.INPUT)
    protected String id;

    /**
     * 取消隐藏的用户名称
     **/
    @Column(length = 30)
    protected String userName;
    /**
     * 话题Id
     **/
    protected Long topicId;
    /**
     * 消费积分
     **/
    protected Long point;
    /**
     * 消费余额  精度为12位，小数点位数为2位
     **/
    protected BigDecimal amount;
    /**
     * 取消隐藏时间
     **/
    @Temporal(TemporalType.TIMESTAMP)
    protected Date cancelTime = new Date();
    /**
     * 隐藏标签类型 10:输入密码可见  40:积分购买可见  50:余额购买可见
     **/
    protected Integer hideTagType;
    /**
     * 发布话题的用户名称
     **/
    @Column(length = 30)
    protected String postUserName;
    /**
     * 话题标题
     **/
    @Transient
    @TableField(exist = false)
    protected String topicTitle;
    /**
     * 呢称
     **/
    @Transient
    @TableField(exist = false)
    private String nickname;
    /**
     * 头像路径
     **/
    @Transient
    @TableField(exist = false)
    private String avatarPath;
    /**
     * 头像名称
     **/
    @Transient
    @TableField(exist = false)
    private String avatarName;
}
